package com.gongzonqiang.pojo;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;

import com.gongzonqiang.myenum.NoticeEnum;

import lombok.Data;

@Data
@Table(name = "`notice`")
public class Notice {
    @Id
    @Column(name = "`notice_id`")
    private Long noticeId;

    @Column(name = "`openId`")
    private String openid;

    @Column(name = "`category_id`")
    private Long categoryId;

    @Column(name = "`price_id`")
    private Integer priceId;

    @Column(name = "`content`")
    private String content;

    @Column(name = "`img`")
    private String img;

    @Column(name = "`phone`")
    private String phone;

    @Column(name = "`browse_num`")
    private Integer browseNum;

    @Column(name = "`collection_num`")
    private Integer collectionNum;

    @Column(name = "`forward_num`")
    private Integer forwardNum;

    /**
     * -1不通过 0审核 1发布- 2逻辑删除
     */
    @Column(name = "`status`")
    private Integer status;

    @Column(name = "`carousel`")
    private Integer carousel;

    @Column(name = "`carousel_day`")
    private Integer carouselDay;

    @Column(name = "`create_date`",insertable=false)
    private Date createDate;

    @Column(name = "`update_date`",updatable=false)
    private Date updateDate;
    
    /**
     * @return notice_id
     */
    public Long getNoticeId() {
        return noticeId;
    }

    /**
     * @param noticeId
     */
    public void setNoticeId(Long noticeId) {
        this.noticeId = noticeId;
    }

    /**
     * @return openId
     */
    public String getOpenid() {
        return openid;
    }

    /**
     * @param openid
     */
    public void setOpenid(String openid) {
        this.openid = openid;
    }

    /**
     * @return category_id
     */
    public Long getCategoryId() {
        return categoryId;
    }

    /**
     * @param categoryId
     */
    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }

    /**
     * @return price_id
     */
    public Integer getPriceId() {
        return priceId;
    }

    /**
     * @param priceId
     */
    public void setPriceId(Integer priceId) {
        this.priceId = priceId;
    }

    /**
     * @return content
     */
    public String getContent() {
        return content;
    }

    /**
     * @param content
     */
    public void setContent(String content) {
        this.content = content;
    }

    /**
     * @return img
     */
    public String getImg() {
        return img;
    }

    /**
     * @param img
     */
    public void setImg(String img) {
        this.img = img;
    }

    /**
     * @return phone
     */
    public String getPhone() {
        return phone;
    }

    /**
     * @param phone
     */
    public void setPhone(String phone) {
        this.phone = phone;
    }

    /**
     * @return browse_num
     */
    public Integer getBrowseNum() {
        return browseNum;
    }

    /**
     * @param browseNum
     */
    public void setBrowseNum(Integer browseNum) {
        this.browseNum = browseNum;
    }

    /**
     * @return collection_num
     */
    public Integer getCollectionNum() {
        return collectionNum;
    }

    /**
     * @param collectionNum
     */
    public void setCollectionNum(Integer collectionNum) {
        this.collectionNum = collectionNum;
    }

    /**
     * @return forward_num
     */
    public Integer getForwardNum() {
        return forwardNum;
    }

    /**
     * @param forwardNum
     */
    public void setForwardNum(Integer forwardNum) {
        this.forwardNum = forwardNum;
    }

    /**
     * 获取-1不通过 0审核 1发布 2逻辑删除
     *
     * @return status - -1不通过 0审核 1发布 -2逻辑删除
     */
    public Integer getStatus() {
        return status;
    }

    /**
     * 设置-1不通过 0审核 1发布 2逻辑删除
     *
     * @param status -1不通过 0审核 1发布 2逻辑删除
     */
    public void setStatus(Integer status) {
        this.status = status;
    }

    /**
     * @return carousel
     */
    public Integer getCarousel() {
        return carousel;
    }

    /**
     * @param carousel
     */
    public void setCarousel(Integer carousel) {
        this.carousel = carousel;
    }

    /**
     * @return carousel_day
     */
    public Integer getCarouselDay() {
        return carouselDay;
    }

    /**
     * @param carouselDay
     */
    public void setCarouselDay(Integer carouselDay) {
        this.carouselDay = carouselDay;
    }

    /**
     * @return create_date
     */
    public Date getCreateDate() {
        return createDate;
    }

    /**
     * @param createDate
     */
    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    /**
     * @return update_date
     */
    public Date getUpdateDate() {
        return updateDate;
    }

    /**
     * @param updateDate
     */
    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }
    
    
    public String getStatusStr() {
    	NoticeEnum[] values = NoticeEnum.values();
    	for(NoticeEnum e : values) {
    		if(e.getCode()==this.status) {
    			return e.getMessage();
    		}
    	}
    	return null;
    }
}